import {FC, useContext} from "react";
import {Route, Switch, Redirect} from "react-router-dom";
import Home from "./Home/Home";
import NavComp from "../components/NavComp/NavComp";
import MainFooter from "../components/MainFooter/MainFooter";
import MainHeader from "../components/MainHeader/MainHeader";
import {mapContext} from "../context";

const App: FC<any> = () => {
    const mapContextValue = useContext(mapContext);
    return (
        <div className="container">
            <MainHeader/>
            <NavComp/>
            <mapContext.Provider value={mapContextValue}>
                <Switch>
                    <Route exact path="/home" component={Home}/>
                    <Redirect to="/home" />
                </Switch>
            </mapContext.Provider>
            <MainFooter/>
        </div>
    );
}

export default App;
